import Vue from 'vue'
import 'normalize.css'
import Element from 'element-ui'
import './assets/styles/element-variables.scss'
import '@/assets/styles/reset.scss'
import '@/assets/styles/index.scss'
import App from './App.vue'
import router from './router'
import store from './store'

import permission from './directive/permission'
//自定义表格工具
import TableTool from '@/components/TableTool'

// 引入rem转换
import 'lib-flexible'
//注册icon
import './assets/icons' // icon

//引入分页插件
import Pagination from '@/components/Pagination'

Vue.use(Element)
Vue.config.productionTip = false
Vue.use(permission)

Vue.directive('highlight', function(el) {
  let blocks = el.querySelectorAll('pre code')
  blocks.forEach(block => {
    hljs.highlightBlock(block)
  })
})

//全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('TableTool', TableTool)

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
